﻿
using Simulation.Framework;
using System.Collections;
using UnityEngine;

namespace Easy.Game2d
{
    public class BulletBossItem : MonoBehaviour
    {
        public int damage = 1;
        private void Start()
        {
            StartCoroutine(WaitHide());
        }
        private void OnTriggerEnter2D(Collider2D collision)
        {
            if (collision.CompareTag("Player"))
            {
                EventUtil.DispatchEvent("AddKouXueClick", 5);
                StartCoroutine(WaitDes());
            }
        }
        private IEnumerator WaitDes()
        {
            this.transform.localScale = new Vector3(0, 0, 0);
            yield return new WaitForSeconds(2);
            Destroy(this.gameObject);
        }
        private IEnumerator WaitHide()
        {
            yield return new WaitForSeconds(15);
            this.transform.localScale = new Vector3(0, 0, 0);
            yield return new WaitForSeconds(1);
            Destroy(this.gameObject);
        }
    }
}
